package speed2010.matcher.gui;
import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class FAbout extends JDialog {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel lblContent;
	private JLabel lblVersion;
	private JLabel lblName;
	private JButton btnOk;
	private JDialog INSTANCE;
	private JFrame owner;

	public FAbout(JFrame owner)
	{
		super(owner, "About", ModalityType.APPLICATION_MODAL);
		this.owner = owner;
		initialize();
		if(INSTANCE == null)
			INSTANCE = this;
			
	}
	
	private void initialize() {
		this.setSize(358, 174);
		this.setTitle("About");
		this.setLayout(null);		
		this.setResizable(false);
		this.setPreferredSize(new Dimension(358, 174));
		this.setLocationRelativeTo(owner);
		this.add(getBtnOk());
		this.add(getLblContent());
	}
	
	private JButton getBtnOk()
	{
		if(btnOk == null)
		{
			btnOk = new JButton();
			btnOk.setText("Ok");
			btnOk.setBounds(124, 111, 86, 20);
			btnOk.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					INSTANCE.dispose();
				}
			});
		}
		return btnOk;
	}
	
	private JPanel getLblContent() {
		if(lblContent == null) {
			lblContent = new JPanel();
			lblContent.setBounds(23, 12, 304, 87);
			lblContent.setBackground(Color.WHITE);
			lblContent.add(getLblName());
			lblContent.add(getLblVersion());
			lblContent.setLayout(null);
		}
		return lblContent;
	}
	
	private JLabel getLblName() {
		if(lblName == null) {
			lblName = new JLabel();
			lblName.setText("SemMatcher");
			lblName.setBounds(12, 5, 101, 23);
			lblName.setFont(new java.awt.Font("Segoe UI",1,12));
		}
		return lblName;
	}
	
	private JLabel getLblVersion() {
		if(lblVersion == null) {
			lblVersion = new JLabel();
			lblVersion.setText("Version 1.0");
			lblVersion.setBounds(12, 28, 74, 16);
		}
		return lblVersion;
	}

}
